/*
 * Created on 2005-7-29
 *
 */
package com.et114.components.ldap4oj.core;

import java.util.ArrayList;
import java.util.Collection;

import javax.naming.NamingException;
import javax.naming.directory.SearchResult;

//import nl.justobjects.pushlet.util.Log;



public class UserCallback extends SearchResultCallbackHandlerSupport {

	private Collection userCollection = new ArrayList();

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.bsisoft.core.ldap.core.SearchResultCallbackHandler#processSearchResult(javax.naming.directory.SearchResult)
	 */
	public void processSearchResult(SearchResult searchResult)
			throws NamingException {
		
		logger.info (  "............" + searchResult.getName ( ) ) ;
		/**
		 * if (AttributeHelper.isInstanceOf(searchResult, "person")) { 
		 *   User user = new User(); 
		 *   user.commonName =  AttributeHelper.getAttributeAsNonNullString( searchResult, "cn");
		 *   user.surname = AttributeHelper.getAttributeAsNonNullString(searchResult, "sn"); 
		 *   userCollection.add(user);
		 * }
		 */

	}

	public Object getResult() {
		return userCollection;
	}

}
